import java.util.Arrays;

public class Test {
    public static int find(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            int t = 0;
            for (int j = 0; j < arr.length; j++) {
                if(i == j) {
                    continue;
                }
                if(arr[i] == arr[j]) {
                    t = 1;
                    break;
                }
            }
            if(t == 0) {
                return i;
            }
        }
        return -1;
    }
    public static void main(String[] args) {
        int[] arr = {2,2,1};
        System.out.println(Arrays.toString(arr));
        System.out.println(arr[find(arr)]);

    }
}
